I specifically remember an interview where Lennon said it was just something he saw on the cover of a gun magazine.
The song is interesting because of it's structure.
"Lennon said he "put together three sections of different songs ... it seemed to run through all the different kinds of rock music."
[1] The song begins with a brief lilting section ("She's not a girl who misses much..."). Drums, bass and distorted guitar are introduced as this portion of the song proceeds. The surreal imagery from this section is allegedly taken from an
acid trip that Lennon and
Derek Taylor experienced, with Taylor contributing the opening lines.
[3] After this, the song transitions into a Lennon song fragment called "I Need a Fix," built around an ominous-sounding guitar riff. This section drifts into the next section, a chorus of "Mother Superior jumped the gun." The final section is a
doo-wop send up, with the back-up of vocals of "bang, bang, shoot shoot."
http://en.wikipedia.org/wiki/Happiness_Is_a_Warm_Gun#Structure